namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0017 : DbMigration
    {
        public override void Up()
        {
            //RenameTable(name: "dbo.HrmMasWorkArea", newName: "hrm_mp_work_areas");
            //RenameTable(name: "dbo.HrmMasJobSiteType", newName: "hrm_mp_job_site_types");
            //RenameTable(name: "dbo.HrmMasJobSiteLevel", newName: "hrm_mp_job_site_levels");
            //RenameTable(name: "dbo.HrmMasDistrict", newName: "mas_districts");
            //RenameTable(name: "dbo.HrmMasProvince", newName: "mas_provinces");
            //RenameTable(name: "dbo.HrmMasCity", newName: "mas_cities");
            //RenameTable(name: "dbo.HrmMasCountry", newName: "mas_countries");
            //RenameTable(name: "dbo.HrmMasJobSiteStatus", newName: "hrm_mp_job_site_statuses");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "WorkAreaId", newName: "work_area_seq");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "Name", newName: "work_area_name");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "ScopeId", newName: "scope_seq");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.hrm_mp_work_areas", name: "UpdatedWhen", newName: "updated_when");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_addmited", newName: "date_admitted");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "JobSiteTypeId", newName: "job_site_type_seq");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "Name", newName: "job_site_type_name");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "CurrentJobSiteId", newName: "curr_job_site_seq");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "UpdatedWhen", newName: "updated_when");
            //RenameColumn(table: "dbo.hrm_mp_job_site_levels", name: "JobSiteLevelId", newName: "job_site_level_seq");
            //RenameColumn(table: "dbo.hrm_mp_job_site_levels", name: "Name", newName: "job_site_level_name");
            //RenameColumn(table: "dbo.mas_districts", name: "DistrictId", newName: "district_seq");
            //RenameColumn(table: "dbo.mas_districts", name: "AmphurId", newName: "amp_seq");
            //RenameColumn(table: "dbo.mas_districts", name: "Code", newName: "district_code");
            //RenameColumn(table: "dbo.mas_districts", name: "Name", newName: "district_name");
            //RenameColumn(table: "dbo.mas_districts", name: "NameEng", newName: "district_name_eng");
            //RenameColumn(table: "dbo.mas_districts", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.mas_districts", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.mas_districts", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.mas_districts", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.mas_districts", name: "UpdatedWhen", newName: "updated_when");
            //RenameColumn(table: "dbo.mas_provinces", name: "ProvinceId", newName: "prov_seq");
            //RenameColumn(table: "dbo.mas_provinces", name: "Code", newName: "prov_code");
            //RenameColumn(table: "dbo.mas_provinces", name: "Name", newName: "prov_name");
            //RenameColumn(table: "dbo.mas_provinces", name: "NameEng", newName: "prov_name_eng");
            //RenameColumn(table: "dbo.mas_provinces", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.mas_provinces", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.mas_provinces", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.mas_provinces", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.mas_provinces", name: "UpdatedWhen", newName: "updated_when");
            //RenameColumn(table: "dbo.mas_cities", name: "CityId", newName: "city_seq");
            //RenameColumn(table: "dbo.mas_cities", name: "CountryId", newName: "country_seq");
            //RenameColumn(table: "dbo.mas_cities", name: "Name", newName: "city_name");
            //RenameColumn(table: "dbo.mas_cities", name: "NameEng", newName: "city_name_eng");
            //RenameColumn(table: "dbo.mas_cities", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.mas_cities", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.mas_cities", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.mas_cities", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.mas_cities", name: "UpdatedWhen", newName: "updated_when");
            //RenameColumn(table: "dbo.mas_countries", name: "CountryId", newName: "country_seq");
            //RenameColumn(table: "dbo.mas_countries", name: "Code", newName: "country_code");
            //RenameColumn(table: "dbo.mas_countries", name: "Name", newName: "country_name");
            //RenameColumn(table: "dbo.mas_countries", name: "NameEng", newName: "country_name_eng");
            //RenameColumn(table: "dbo.mas_countries", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.mas_countries", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.mas_countries", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.mas_countries", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.mas_countries", name: "UpdatedWhen", newName: "updated_when");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "JobSiteStatusId", newName: "job_site_stat_seq");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "Name", newName: "job_site_stat_name");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "RecordStatus", newName: "record_status");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "CreatedBy", newName: "created_by");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "CreatedWhen", newName: "created_when");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "UpdatedBy", newName: "updated_by");
            //RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "UpdatedWhen", newName: "updated_when");
            AlterColumn("dbo.hrm_mp_job_site_types", "remarks", c => c.String());
        }
        
        public override void Down()
        {
            AlterColumn("dbo.hrm_mp_job_site_types", "Remarks", c => c.String());
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "job_site_stat_name", newName: "Name");
            RenameColumn(table: "dbo.hrm_mp_job_site_statuses", name: "job_site_stat_seq", newName: "JobSiteStatusId");
            RenameColumn(table: "dbo.mas_countries", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.mas_countries", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.mas_countries", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.mas_countries", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.mas_countries", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.mas_countries", name: "country_name_eng", newName: "NameEng");
            RenameColumn(table: "dbo.mas_countries", name: "country_name", newName: "Name");
            RenameColumn(table: "dbo.mas_countries", name: "country_code", newName: "Code");
            RenameColumn(table: "dbo.mas_countries", name: "country_seq", newName: "CountryId");
            RenameColumn(table: "dbo.mas_cities", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.mas_cities", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.mas_cities", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.mas_cities", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.mas_cities", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.mas_cities", name: "city_name_eng", newName: "NameEng");
            RenameColumn(table: "dbo.mas_cities", name: "city_name", newName: "Name");
            RenameColumn(table: "dbo.mas_cities", name: "country_seq", newName: "CountryId");
            RenameColumn(table: "dbo.mas_cities", name: "city_seq", newName: "CityId");
            RenameColumn(table: "dbo.mas_provinces", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.mas_provinces", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.mas_provinces", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.mas_provinces", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.mas_provinces", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.mas_provinces", name: "prov_name_eng", newName: "NameEng");
            RenameColumn(table: "dbo.mas_provinces", name: "prov_name", newName: "Name");
            RenameColumn(table: "dbo.mas_provinces", name: "prov_code", newName: "Code");
            RenameColumn(table: "dbo.mas_provinces", name: "prov_seq", newName: "ProvinceId");
            RenameColumn(table: "dbo.mas_districts", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.mas_districts", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.mas_districts", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.mas_districts", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.mas_districts", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.mas_districts", name: "district_name_eng", newName: "NameEng");
            RenameColumn(table: "dbo.mas_districts", name: "district_name", newName: "Name");
            RenameColumn(table: "dbo.mas_districts", name: "district_code", newName: "Code");
            RenameColumn(table: "dbo.mas_districts", name: "amp_seq", newName: "AmphurId");
            RenameColumn(table: "dbo.mas_districts", name: "district_seq", newName: "DistrictId");
            RenameColumn(table: "dbo.hrm_mp_job_site_levels", name: "job_site_level_name", newName: "Name");
            RenameColumn(table: "dbo.hrm_mp_job_site_levels", name: "job_site_level_seq", newName: "JobSiteLevelId");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "curr_job_site_seq", newName: "CurrentJobSiteId");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "job_site_type_name", newName: "Name");
            RenameColumn(table: "dbo.hrm_mp_job_site_types", name: "job_site_type_seq", newName: "JobSiteTypeId");
            RenameColumn(table: "dbo.hrm_ps_employees", name: "date_admitted", newName: "date_addmited");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "updated_when", newName: "UpdatedWhen");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "updated_by", newName: "UpdatedBy");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "created_when", newName: "CreatedWhen");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "created_by", newName: "CreatedBy");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "record_status", newName: "RecordStatus");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "scope_seq", newName: "ScopeId");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "work_area_name", newName: "Name");
            RenameColumn(table: "dbo.hrm_mp_work_areas", name: "work_area_seq", newName: "WorkAreaId");
            RenameTable(name: "dbo.hrm_mp_job_site_statuses", newName: "HrmMasJobSiteStatus");
            RenameTable(name: "dbo.mas_countries", newName: "HrmMasCountry");
            RenameTable(name: "dbo.mas_cities", newName: "HrmMasCity");
            RenameTable(name: "dbo.mas_provinces", newName: "HrmMasProvince");
            RenameTable(name: "dbo.mas_districts", newName: "HrmMasDistrict");
            RenameTable(name: "dbo.hrm_mp_job_site_levels", newName: "HrmMasJobSiteLevel");
            RenameTable(name: "dbo.hrm_mp_job_site_types", newName: "HrmMasJobSiteType");
            RenameTable(name: "dbo.hrm_mp_work_areas", newName: "HrmMasWorkArea");
        }
    }
}
